package com.galaxy.order.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.order.domain.OrderRefund;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单退款业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = OrderRefund.class)
public class OrderRefundBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 订单ID
     */
    @NotNull(message = "订单ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long orderId;

    /**
     * 订单编号
     */
    @NotBlank(message = "订单编号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderNo;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long userId;

    /**
     * 退款单号
     */
    @NotBlank(message = "退款单号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String refundNo;

    /**
     * 退款金额
     */
    @NotNull(message = "退款金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal refundAmount;

    /**
     * 退款类型(1:整单退款,2:部分退款)
     */
    @NotNull(message = "退款类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer refundType;

    /**
     * 退款原因
     */
    @NotBlank(message = "退款原因不能为空", groups = {AddGroup.class, EditGroup.class})
    private String reason;

    /**
     * 退款状态(0:待处理,1:已同意,2:已拒绝)
     */
    @NotNull(message = "退款状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 处理时间
     */
    private LocalDateTime handleTime;

    /**
     * 处理结果
     */
    private String handleResult;

    /**
     * 租户ID
     */
    private String tenantId;
}
